#lang rosetta-racket


(provide pillow)


(define (pillow cr sr br n shape-fn)
  (loft-closed
   (map
    (λ (segment i)
      (move
       (segment-object segment)
       (rotate pi/2 (segment-normal segment) (shape-fn cr sr br n i))))
    (cut (par (circle cr)) n)
    (: n))))